//
//  ZZDetailViewController.swift
//  sina
//
//  Created by 张鹏 on 16/5/21.
//  Copyright © 2016年 ZP. All rights reserved.
//

import UIKit

class ZZDetailViewController: ZZBaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        //设置背景色
        view.backgroundColor = UIColor.whiteColor()
        
        //设置背景
        let back = UIBarButtonItem(imageName: "navigationbar_back_withtext", title: "返回", target: self, action: #selector(ZZDetailViewController.back))
        
        //自定义返回按钮
        self.navigationItem.leftBarButtonItem = back
        
        //进入多级界面
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", style: .Plain, target: self, action: #selector(nextController))
        
    }

    @objc private func nextController() {
    
        //在自己界面跳转自己,就能一直跳
    let next = ZZDetailViewController()
        
        
        self.navigationController?.pushViewController(next, animated: true)
    
    }
    
    
    @objc private func back() {
    
        //跳转到下一个界面
       self.navigationController?.popViewControllerAnimated(true)
    
    }
 
    
}

